﻿$(function(){
        var cWidth = $(window).width();
        var cHeight = $(window).height();
        $("#body_bg").attr("width", cWidth *1.2).attr("height", cHeight*1.2); 
        var body_canvas = document.getElementById('body_bg');
       // var ctx = document.getCSSCanvasContext("2d","bg",cWidth,cHeight);
        var body_options = {
        stripes : [ 
        {
            color: '#092537',
            rotation: 159,
            opacity: 50,
            mode: 'plaid',
            width: 79,
            gap: 281,
            offset: 284
        },
        {
            color: '#092637',
            rotation: 45,
            opacity: 50,
            mode: 'plaid',
            width: 9,
            gap: 351,
            offset: 149
        },
        {
            color: '#1b5d84',
            rotation: 45,
            opacity: 50,
            mode: 'plaid',
            width: 135,
            gap: 225,
            offset: 95
        },
        {
           color: '#1b5d84',
           rotation: 45,
           opacity: 65,
           mode: 'plaid',
           width: 56,
           gap: 331,
           offset: 327
       },
       {
           color: '#E1F4FD',
           rotation: 45,
           opacity: 57,
           mode: 'plaid',
           width: 45,
           gap: 315,
           offset: 140
       },
       {
           color: '#E1F4FD',
           rotation: 45,
           opacity: 50,
           mode: 'plaid',
           width: 36,
           gap: 324,
           offset: 320
       }
        ],
        bg : '#ffffff'
    }
    //patternizer.stripe(ctx, options, cWidth, cHeight);
    patternizer.stripe(body_canvas, body_options);
    $('body').css({'background-image':"url(" + body_canvas.toDataURL("image/png")+ ")" });
});
